package com.coolxiaoyao.common.mapping;

import com.coolxiaoyao.common.http.HttpMethod;



import java.util.Map;


/**
 * @author Kerry on 18/09/20
 */

public class SimpleUrlMappingHandler {

    public static Map<HttpMethod, UrlMapping> matchUrl(String url) {
        if (urlMapping == null) {
            return null;
        }
        return urlMapping.get(url);
    }

    /**
     * <pre>
     * <URL,<HttpMethod,HandlerMapping>>
     * </pre>
     */
    private static Map<String, Map<HttpMethod, UrlMapping>> urlMapping;

    public static void setUrlMapping(Map<String, Map<HttpMethod, UrlMapping>> urlMapping) {
        SimpleUrlMappingHandler.urlMapping = urlMapping;
    }

}
